#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : chat_model_model.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/3 9:40
from tortoise import fields

from apps.models.base_model import BaseModel
from apps.utils.enumerate import ModelTypeEnum


class ChatModel(BaseModel):
    __doc__ = "聊天模型配置表"
    model_name_zh = fields.CharField(max_length=256, null=False, description='模型名称中文')
    model_name = fields.CharField(max_length=256, null=False, description='模型名称')
    model_base_url = fields.CharField(max_length=256, null=True, description='模型基础地址')
    firm = fields.IntEnumField(ModelTypeEnum, default=ModelTypeEnum.zhipu, description='模型厂商', null=False)
    api_key = fields.CharField(max_length=256, null=True, description='api_key')
    description = fields.CharField(max_length=256, null=True, description='描述')
    is_default = fields.BooleanField(default=False, description='是否默认')

    class Meta:
        table = "chat_model"
        table_description = "聊天模型配置表"
